package com.yy.wga.mp.module.goods.common.typeHandler;


import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.handlers.AbstractJsonTypeHandler;
import com.yy.wga.mp.module.goods.entity.pojo.GoodsSpuDO;
import com.yy.wga.mp.module.goods.entity.pojo.GoodsSpuDO;
import com.yy.wga.mp.module.goods.entity.pojo.GoodsSpuDO;
import com.yy.wga.mp.module.goods.entity.pojo.GoodsSpuDO;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: gc
 * @Date: 2024/12/1
 * @Description:
 **/
@Component
public class GoodsSpuJacksonTypeHandler extends AbstractJsonTypeHandler<List<GoodsSpuDO.Sku>> {
    @Override
    protected List<GoodsSpuDO.Sku> parse(String json) {
        return JSON.parseArray(json, GoodsSpuDO.Sku.class);
    }

    @Override
    protected String toJson(List<GoodsSpuDO.Sku> obj) {
        return JSON.toJSONString(obj);
    }
}

